/**
 * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.md or http://ckeditor.com/license
 */

CKEDITOR.editorConfig = function( config ) {
	// Define changes to default configuration here.
	// For complete reference see:
	// http://docs.ckeditor.com/#!/api/CKEDITOR.config

	// The toolbar groups arrangement, optimized for two toolbar rows.
	config.toolbarGroups = [
		{ name: 'clipboard',   groups: [ 'clipboard', 'undo' ] },
		{ name: 'editing',     groups: [ 'find', 'selection', 'spellchecker' ] },
		{ name: 'links' },
		{ name: 'insert' },
		{ name: 'forms' },
		{ name: 'tools' },
		{ name: 'document',	   groups: [ 'mode', 'document', 'doctools' ] },
		{ name: 'others' },
		'/',
		{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
		{ name: 'paragraph',   groups: [ 'list', 'indent', 'blocks', 'align', 'bidi' ] },
		{ name: 'styles' },
		{ name: 'colors' },
		{ name: 'about' }
	];

	// Remove some buttons provided by the standard plugins, which are
	// not needed in the Standard(s) toolbar.
	config.removeButtons = 'Underline,Subscript,Superscript';

	// Set the most common block elements.
	config.format_tags = 'p;h1;h2;h3;pre';

	// Simplify the dialog windows.
//	config.language = 'zh-cn';
//    config.skin = 'kama';
	config.removeDialogTabs = 'image:advanced;link:advanced';
	config.image_previewText=' '; //预览区域显示内容
	var location = (window.location+'').split('/');
    var basePath = location[0]+'//'+location[2]+'/'+location[3]+"/";
    if (navigator.userAgent.indexOf('Firefox') >= 0){
                     basePath="";
    }else{
            basePath = basePath.substring(0,basePath.indexOf('admin'));
    }
//    alert("basePath="+basePath);
    config.filebrowserBrowseUrl = basePath+'ckfinder/ckfinder.html?type=Files';
    config.filebrowserUploadUrl= basePath+"ckfinder/core/connector/java/connector.java?command=QuickUpload&type=Files";
    config.filebrowserImageBrowseUrl = basePath+'ckfinder/ckfinder.html?type=Images';
	config.filebrowserImageUploadUrl= basePath+"ckfinder/core/connector/java/connector.java?command=QuickUpload&type=Images"; //待会要上传的action或servlet
	config.filebrowserFlashBrowseUrl = basePath+'ckfinder/ckfinder.html?type=Flash' ;
	config.filebrowserFlashUploadUrl = basePath+'ckfinder/core/connector/java/connector.java?command=QuickUpload&type=Flash';
    config.height = '500px'; // 高度  
    config.toolbar = 'Full';// 工具栏风格Full,Basic
     config.toolbar_Full =
     [
         ['Save','Preview','-','Templates'],
         ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Print', 'SpellChecker', 'Scayt'],
         ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
         ['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
         ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
         ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
         ['Link','Unlink','Anchor','Image','Flash','Video','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
         '/',
         ['Styles','Format','Font','FontSize','lineheight'],
         ['TextColor','BGColor'],
         ['Maximize', 'ShowBlocks']
     ];
   
     config.toolbar_Basic =
      [
      ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink','-','About']
      ];
     config.extraPlugins = 'video';
};
